package edu.zut.process;

public class Demo4 {

    public static void main(String[] args) {
        //计算10的阶乘结果    1 * 2 * 3 .... * 10
        int i = 1;//初始化开始
        int factorial = 1;  //阶乘的初始值 1
        while (i <= 10){
            factorial = i * factorial;
            i ++;
        }
        System.out.println("factorial = " + factorial);

        //do  while改写 自行练习


        //while循环可以嵌套,不经常使用
        /*while (){
            while (){

            }
        }*/
    }

}
